import { createApp } from "vue";
import App from "./App.vue";
import "./style/index.scss";
// 导入pinia
import { createPinia } from "pinia";
import router from "./router/index";
// 导入element-plus
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// 导入echarts图
import * as echarts from 'echarts'

import * as ElIcons from "@element-plus/icons-vue";
import svgIcon from "./components/SvgIcon/index.vue";
import "virtual:svg-icons-register"; // 引入svg icon注册脚本

const pinia = createPinia();
const app = createApp(App);
for (const iconName in ElIcons) {
  app.component(iconName, ElIcons[iconName as keyof typeof ElIcons]);
}
app.use(pinia);
app.use(router);
app.use(ElementPlus, { locale: zhCn })
app.component("svg-icon", svgIcon);
app.config.globalProperties.$echarts = echarts;
// app.config.globalProperties.$imgUrl4 = 'http://localhost:8083/';

let baseUrl='http://localhost:8083/';
app.provide('baseUrl', {
  baseUrl,
})

app.mount("#app");
